﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RMM
{
    public class ResultDto
    {

        public static readonly ResultDto Successed = new ResultDto(0, "", "");
        public static readonly ResultDto Failed = new ResultDto(-1, "", "");

        public static ResultDto Success(object data)
        {
            return new ResultDto(0, "成功", data);
        }

        public static ResultDto Fail(string msg)
        {
            return new ResultDto(-1, msg, null);
        }

        public static ResultDto NoRegister(string msg)
        {
            return new ResultDto(-998, msg, null);
        }

        public static ResultDto AuthorizeFail()
        {
            return new ResultDto(-999, "登陆超时", null);
        }

        public ResultDto(int code, string msg, object data)
        {
            Code = code;
            Msg = msg;
            Data = data;
        }

        public int Code { get; set; }

        public string Msg { get; set; }

        public object Data { get; set; }
    }
}
